<?php
// +----------------------------------------------------------------------
// | Author: 发仔 <i@fazi.me> 
// +----------------------------------------------------------------------

namespace app\admin\controller;

use think\Db;

class Area extends Base
{
	protected $id = 'area_id';
	protected $table = 'area';
	
    public function index() {
		
		$this->all();
		$this->assign('list',$this->all);
		return $this->out();
		
	}
	
	public function all() {
		$this->all = Db::name('area')->select();
		$this->tree = Arr2Sibling($this->all,0,0,'area_id','area_pid');
	}

	protected function options($item = []) {
		
		$this->all();
		$this->assign('area_pids',TplOptions($this->tree,$item['area_pid'],'area_name','area_id'));
		
	}
    
}
